import time
import asyncio

import aiohttp

url_list = ['http://www.baidu.com'] * 5


async def request_url(url):
    async with aiohttp.ClientSession() as session:
        async with session.get(url) as response:
            text = await response.text()
            print(text)


async def main():
    for url in url_list:
        await request_url(url)


if __name__ == '__main__':
    start_time = time.time()
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())
    print(time.time() - start_time)
